<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Class unit_test_log_formatter</title>
<link rel="stylesheet" href="../../boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="Boost.Test">
<link rel="up" href="../../header/boost/test/unit_test_log_formatter_hpp.html" title="Header &lt;boost/test/unit_test_log_formatter.hpp&gt;">
<link rel="prev" href="log_entry_data.html" title="Struct log_entry_data">
<link rel="next" href="../../header/boost/test/unit_test_parameters_hpp.html" title="Header &lt;boost/test/unit_test_parameters.hpp&gt;">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="log_entry_data.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../header/boost/test/unit_test_log_formatter_hpp.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../../header/boost/test/unit_test_parameters_hpp.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.unit_test.unit_test_log_formatter"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class unit_test_log_formatter</span></h2>
<p>boost::unit_test::unit_test_log_formatter — Abstract Unit Test Framework log formatter interface. </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../header/boost/test/unit_test_log_formatter_hpp.html" title="Header &lt;boost/test/unit_test_log_formatter.hpp&gt;">boost/test/unit_test_log_formatter.hpp</a>&gt;

</span>
<span class="keyword">class</span> <a class="link" href="unit_test_log_formatter.html" title="Class unit_test_log_formatter">unit_test_log_formatter</a> <span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>

  <span class="comment">// Types of log entries (messages written into a log) </span>
  <span class="keyword">enum</span> <a name="boost.unit_test.unit_test_log_formatter.log_entry_types"></a>log_entry_types <span class="special">{</span> BOOST_UTL_ET_INFO, BOOST_UTL_ET_MESSAGE, 
                         BOOST_UTL_ET_WARNING, BOOST_UTL_ET_ERROR, 
                         BOOST_UTL_ET_FATAL_ERROR <span class="special">}</span><span class="special">;</span>
  <span class="comment">// <a class="link" href="unit_test_log_formatter.html#boost.unit_test.unit_test_log_formatterconstruct-copy-destruct">construct/copy/destruct</a></span>
  <a class="link" href="unit_test_log_formatter.html#idm47978-bb"><span class="identifier">unit_test_log_formatter</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="unit_test_log_formatter.html#idm47980-bb"><span class="special">~</span><span class="identifier">unit_test_log_formatter</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="unit_test_log_formatter.html#idm47656-bb">public member functions</a></span>
  <span class="keyword">virtual</span> <span class="keyword">void</span> <a class="link" href="unit_test_log_formatter.html#idm47657-bb"><span class="identifier">log_start</span></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">counter_t</span><span class="special">)</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
  <span class="keyword">virtual</span> <span class="keyword">void</span> <a class="link" href="unit_test_log_formatter.html#idm47673-bb"><span class="identifier">log_finish</span></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&amp;</span><span class="special">)</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
  <span class="keyword">virtual</span> <span class="keyword">void</span> <a class="link" href="unit_test_log_formatter.html#idm47685-bb"><span class="identifier">log_build_info</span></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&amp;</span><span class="special">,</span> <span class="keyword">bool</span> <span class="special">=</span> <span class="keyword">true</span><span class="special">)</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
  <span class="keyword">virtual</span> <span class="keyword">void</span> <a class="link" href="unit_test_log_formatter.html#idm47699-bb"><span class="identifier">test_unit_start</span></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&amp;</span><span class="special">,</span> <a class="link" href="test_unit.html" title="Class test_unit">test_unit</a> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
  <span class="keyword">virtual</span> <span class="keyword">void</span> 
  <a class="link" href="unit_test_log_formatter.html#idm47716-bb"><span class="identifier">test_unit_finish</span></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&amp;</span><span class="special">,</span> <a class="link" href="test_unit.html" title="Class test_unit">test_unit</a> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">,</span> <span class="keyword">unsigned</span> <span class="keyword">long</span><span class="special">)</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
  <span class="keyword">virtual</span> <span class="keyword">void</span> 
  <a class="link" href="unit_test_log_formatter.html#idm47737-bb"><span class="identifier">test_unit_skipped</span></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&amp;</span><span class="special">,</span> <a class="link" href="test_unit.html" title="Class test_unit">test_unit</a> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">const_string</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">virtual</span> <span class="keyword">void</span> <a class="link" href="unit_test_log_formatter.html#idm47753-bb"><span class="identifier">test_unit_skipped</span></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&amp;</span><span class="special">,</span> <a class="link" href="test_unit.html" title="Class test_unit">test_unit</a> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">virtual</span> <span class="keyword">void</span> <a class="link" href="unit_test_log_formatter.html#idm47766-bb"><span class="identifier">test_unit_aborted</span></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&amp;</span><span class="special">,</span> <a class="link" href="test_unit.html" title="Class test_unit">test_unit</a> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">virtual</span> <span class="keyword">void</span> <a class="link" href="unit_test_log_formatter.html#idm47774-bb"><span class="identifier">test_unit_timed_out</span></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&amp;</span><span class="special">,</span> <a class="link" href="test_unit.html" title="Class test_unit">test_unit</a> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">virtual</span> <span class="keyword">void</span> 
  <a class="link" href="unit_test_log_formatter.html#idm47782-bb"><span class="identifier">log_exception_start</span></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&amp;</span><span class="special">,</span> <a class="link" href="log_checkpoint_data.html" title="Struct log_checkpoint_data">log_checkpoint_data</a> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">,</span> 
                      <a class="link" href="../execution_exception.html" title="Class execution_exception">execution_exception</a> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
  <span class="keyword">virtual</span> <span class="keyword">void</span> <a class="link" href="unit_test_log_formatter.html#idm47817-bb"><span class="identifier">log_exception_finish</span></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&amp;</span><span class="special">)</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
  <span class="keyword">virtual</span> <span class="keyword">void</span> 
  <a class="link" href="unit_test_log_formatter.html#idm47829-bb"><span class="identifier">log_entry_start</span></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&amp;</span><span class="special">,</span> <a class="link" href="log_entry_data.html" title="Struct log_entry_data">log_entry_data</a> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">log_entry_types</span><span class="special">)</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
  <span class="keyword">virtual</span> <span class="keyword">void</span> <a class="link" href="unit_test_log_formatter.html#idm47852-bb"><span class="identifier">log_entry_value</span></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">const_string</span><span class="special">)</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
  <span class="keyword">virtual</span> <span class="keyword">void</span> <a class="link" href="unit_test_log_formatter.html#idm47868-bb"><span class="identifier">log_entry_value</span></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">lazy_ostream</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">virtual</span> <span class="keyword">void</span> <a class="link" href="unit_test_log_formatter.html#idm47884-bb"><span class="identifier">log_entry_finish</span></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&amp;</span><span class="special">)</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
  <span class="keyword">virtual</span> <span class="keyword">void</span> <a class="link" href="unit_test_log_formatter.html#idm47896-bb"><span class="identifier">entry_context_start</span></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">log_level</span><span class="special">)</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
  <span class="keyword">virtual</span> <span class="keyword">void</span> <a class="link" href="unit_test_log_formatter.html#idm47912-bb"><span class="identifier">log_entry_context</span></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">log_level</span><span class="special">,</span> <span class="identifier">const_string</span><span class="special">)</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
  <span class="keyword">virtual</span> <span class="keyword">void</span> <a class="link" href="unit_test_log_formatter.html#idm47932-bb"><span class="identifier">entry_context_finish</span></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">log_level</span><span class="special">)</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
  <span class="keyword">virtual</span> <span class="keyword">void</span> <a class="link" href="unit_test_log_formatter.html#idm47948-bb"><span class="identifier">set_log_level</span></a><span class="special">(</span><span class="identifier">log_level</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">virtual</span> <span class="identifier">log_level</span> <a class="link" href="unit_test_log_formatter.html#idm47958-bb"><span class="identifier">get_log_level</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="keyword">virtual</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <a class="link" href="unit_test_log_formatter.html#idm47966-bb"><span class="identifier">get_default_stream_description</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm62662"></a><h2>Description</h2>
<p>During the test module execution Unit Test Framework can report messages about success or failure of assertions, which test suites are being run and more (specifically which messages are reported depends on log level threshold selected by the user).</p>
<p>All these messages constitute Unit Test Framework log. There are many ways (formats) to present these messages to the user.</p>
<p>Boost.Test comes with three formats:</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem"><p>Compiler-like log format: intended for human consumption/diagnostic</p></li>
<li class="listitem"><p>XML based log format: intended for processing by automated regression test systems.</p></li>
<li class="listitem"><p>JUNIT based log format: intended for processing by automated regression test systems.</p></li>
</ul></div>
<p>
</p>
<p>If you want to produce some other format you need to implement class with specific interface and use method <code class="computeroutput">unit_test_log_t::set_formatter</code> during a test module initialization to set an active formatter. The class <a class="link" href="unit_test_log_formatter.html" title="Class unit_test_log_formatter">unit_test_log_formatter</a> defines this interface.</p>
<p>This interface requires you to format all possible messages being produced in the log. These includes error messages about failed assertions, messages about caught exceptions and information messages about test units being started/ended. All the methods in this interface takes a reference to standard stream as a first argument. This is where final messages needs to be directed to. Also you are given all the information necessary to produce a message.</p>
<p><b>Since Boost 1.62: </b></p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem"><p>Each formatter may indicate the default output stream. This is convenient for instance for streams intended for automated processing that indicate a file. See <code class="computeroutput">get_default_stream_description</code> for more details.</p></li>
<li class="listitem"><p>Each formatter may manage its own log level through the getter/setter <code class="computeroutput">get_log_level</code> and <code class="computeroutput">set_log_level</code> .</p></li>
</ul></div>
<p>
</p>
<p>
</p>
<p><span class="bold"><strong>See Also:</strong></span></p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a class="link" href="test_observer.html" title="Class test_observer">boost::unit_test::test_observer</a> for an indication of the calls of the test observer interface </p></li></ul></div>
<p>
</p>
<p>
</p>
<p>
</p>
<div class="refsect2">
<a name="idm62697"></a><h3>
<a name="boost.unit_test.unit_test_log_formatterconstruct-copy-destruct"></a><code class="computeroutput">unit_test_log_formatter</code> 
        public
       construct/copy/destruct</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><a name="idm47978-bb"></a><span class="identifier">unit_test_log_formatter</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>Constructor. </li>
<li class="listitem"><pre class="literallayout"><a name="idm47980-bb"></a><span class="special">~</span><span class="identifier">unit_test_log_formatter</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre></li>
</ol></div>
</div>
<div class="refsect2">
<a name="idm62719"></a><h3>
<a name="idm47656-bb"></a><code class="computeroutput">unit_test_log_formatter</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="keyword">virtual</span> <span class="keyword">void</span> <a name="idm47657-bb"></a><span class="identifier">log_start</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&amp;</span> os<span class="special">,</span> <span class="identifier">counter_t</span> test_cases_amount<span class="special">)</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span></pre>Invoked at the beginning of test module execution. <p>
</p>
<p><span class="bold"><strong>See Also:</strong></span></p>
<p>log_finish </p>
<p>
</p>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">os</code></span></p></td>
<td><p>output stream to write a messages to </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">test_cases_amount</code></span></p></td>
<td><p>total test case amount to be run </p></td>
</tr>
</tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">virtual</span> <span class="keyword">void</span> <a name="idm47673-bb"></a><span class="identifier">log_finish</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&amp;</span> os<span class="special">)</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span></pre>Invoked at the end of test module execution. <p>
</p>
<p><span class="bold"><strong>See Also:</strong></span></p>
<p>log_start </p>
<p>
</p>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">os</code></span></p></td>
<td><p>output stream to write a messages into </p></td>
</tr></tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">virtual</span> <span class="keyword">void</span> <a name="idm47685-bb"></a><span class="identifier">log_build_info</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&amp;</span> os<span class="special">,</span> <span class="keyword">bool</span> log_build_info <span class="special">=</span> <span class="keyword">true</span><span class="special">)</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span></pre>Invoked when Unit Test Framework build information is requested. <p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">log_build_info</code></span></p></td>
<td><p>indicates if build info should be logged or not </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">os</code></span></p></td>
<td><p>output stream to write a messages into </p></td>
</tr>
</tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">virtual</span> <span class="keyword">void</span> <a name="idm47699-bb"></a><span class="identifier">test_unit_start</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&amp;</span> os<span class="special">,</span> <a class="link" href="test_unit.html" title="Class test_unit">test_unit</a> <span class="keyword">const</span> <span class="special">&amp;</span> tu<span class="special">)</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span></pre>Invoked when test unit starts (either test suite or test case) <p>
</p>
<p><span class="bold"><strong>See Also:</strong></span></p>
<p>test_unit_finish </p>
<p>
</p>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">os</code></span></p></td>
<td><p>output stream to write a messages into </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">tu</code></span></p></td>
<td><p>test unit being started </p></td>
</tr>
</tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">virtual</span> <span class="keyword">void</span> 
<a name="idm47716-bb"></a><span class="identifier">test_unit_finish</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&amp;</span> os<span class="special">,</span> <a class="link" href="test_unit.html" title="Class test_unit">test_unit</a> <span class="keyword">const</span> <span class="special">&amp;</span> tu<span class="special">,</span> 
                 <span class="keyword">unsigned</span> <span class="keyword">long</span> elapsed<span class="special">)</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span></pre>Invoked when test unit finishes. <p>
</p>
<p><span class="bold"><strong>See Also:</strong></span></p>
<p>test_unit_start </p>
<p>
</p>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">elapsed</code></span></p></td>
<td><p>time in microseconds spend executing this test unit </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">os</code></span></p></td>
<td><p>output stream to write a messages into </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">tu</code></span></p></td>
<td><p>test unit being finished </p></td>
</tr>
</tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">virtual</span> <span class="keyword">void</span> 
<a name="idm47737-bb"></a><span class="identifier">test_unit_skipped</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&amp;</span> os<span class="special">,</span> <a class="link" href="test_unit.html" title="Class test_unit">test_unit</a> <span class="keyword">const</span> <span class="special">&amp;</span> tu<span class="special">,</span> <span class="identifier">const_string</span><span class="special">)</span><span class="special">;</span></pre>Invoked if test unit skipped for any reason. <p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">os</code></span></p></td>
<td><p>output stream to write a messages into </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">tu</code></span></p></td>
<td><p>skipped test unit </p></td>
</tr>
</tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">virtual</span> <span class="keyword">void</span> <a name="idm47753-bb"></a><span class="identifier">test_unit_skipped</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&amp;</span><span class="special">,</span> <a class="link" href="test_unit.html" title="Class test_unit">test_unit</a> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span></pre>Deprecated version of this interface. <p><span style="color: red">&lt;xrefsect&gt;<span style="color: red">&lt;xreftitle&gt;Deprecated&lt;/xreftitle&gt;</span><span style="color: red">&lt;xrefdescription&gt;&lt;/xrefdescription&gt;</span>&lt;/xrefsect&gt;</span></p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">virtual</span> <span class="keyword">void</span> <a name="idm47766-bb"></a><span class="identifier">test_unit_aborted</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&amp;</span><span class="special">,</span> <a class="link" href="test_unit.html" title="Class test_unit">test_unit</a> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span></pre>Invoked when a test unit is aborted. </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">virtual</span> <span class="keyword">void</span> <a name="idm47774-bb"></a><span class="identifier">test_unit_timed_out</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&amp;</span><span class="special">,</span> <a class="link" href="test_unit.html" title="Class test_unit">test_unit</a> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span></pre>Invoked when a test unit times-out. </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">virtual</span> <span class="keyword">void</span> 
<a name="idm47782-bb"></a><span class="identifier">log_exception_start</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&amp;</span> os<span class="special">,</span> <a class="link" href="log_checkpoint_data.html" title="Struct log_checkpoint_data">log_checkpoint_data</a> <span class="keyword">const</span> <span class="special">&amp;</span> lcd<span class="special">,</span> 
                    <a class="link" href="../execution_exception.html" title="Class execution_exception">execution_exception</a> <span class="keyword">const</span> <span class="special">&amp;</span> ex<span class="special">)</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span></pre>Invoked when Unit Test Framework detects uncaught exception. <p>The framwork calls this function when an uncaught exception it detected. This call is followed by context information:</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem"><p>one call to <code class="computeroutput">entry_context_start</code>,</p></li>
<li class="listitem"><p>as many calls to <code class="computeroutput">log_entry_context</code> as there are context entries</p></li>
<li class="listitem"><p>one call to <code class="computeroutput">entry_context_finish</code> </p></li>
</ul></div>
<p>
</p>
<p>The logging of the exception information is finilized by a call to <code class="computeroutput">log_exception_finish</code>.</p>
<p>
</p>
<p><span class="bold"><strong>See Also:</strong></span></p>
<p>log_exception_finish </p>
<p>
</p>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">ex</code></span></p></td>
<td><p>information about the caught exception </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">lcd</code></span></p></td>
<td><p>information about the last checkpoint before the exception was triggered </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">os</code></span></p></td>
<td><p>output stream to write a messages into </p></td>
</tr>
</tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">virtual</span> <span class="keyword">void</span> <a name="idm47817-bb"></a><span class="identifier">log_exception_finish</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&amp;</span> os<span class="special">)</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span></pre>Invoked when Unit Test Framework detects uncaught exception. <p>Call to this function finishes uncaught exception report. 
</p>
<p><span class="bold"><strong>See Also:</strong></span></p>
<p>log_exception_start </p>
<p>
</p>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">os</code></span></p></td>
<td><p>output stream to write a messages into </p></td>
</tr></tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">virtual</span> <span class="keyword">void</span> 
<a name="idm47829-bb"></a><span class="identifier">log_entry_start</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&amp;</span> os<span class="special">,</span> <a class="link" href="log_entry_data.html" title="Struct log_entry_data">log_entry_data</a> <span class="keyword">const</span> <span class="special">&amp;</span> led<span class="special">,</span> 
                <span class="identifier">log_entry_types</span> let<span class="special">)</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span></pre>Invoked by Unit Test Framework to start new log entry. <p>Call to this function starts new log entry. It is followed by series of log_entry_value calls and finally call to log_entry_finish. A log entry may consist of one or more values being reported. Some of these values will be plain strings, while others can be complicated expressions in a form of "lazy" expression template lazy_ostream. 
</p>
<p><span class="bold"><strong>See Also:</strong></span></p>
<p>log_entry_value, log_entry_finish</p>
<p>
</p>
<p>
</p>
<div class="note"><table border="0" summary="Note">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../../../../doc/src/images/note.png"></td>
<th align="left">Note</th>
</tr>
<tr><td align="left" valign="top"><p>call to this function may happen before any call to test_unit_start or all calls to test_unit_finish as the framework might log errors raised during global initialization/shutdown. </p></td></tr>
</table></div>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">led</code></span></p></td>
<td><p>log entry attributes </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">let</code></span></p></td>
<td><p>log entry type log_entry_finish </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">os</code></span></p></td>
<td><p>output stream to write a messages into </p></td>
</tr>
</tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">virtual</span> <span class="keyword">void</span> <a name="idm47852-bb"></a><span class="identifier">log_entry_value</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&amp;</span> os<span class="special">,</span> <span class="identifier">const_string</span> value<span class="special">)</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span></pre>Invoked by Unit Test Framework to report a log entry content. <p>This is one of two overloaded methods to report log entry content. This one is used to report plain string value. 
</p>
<p><span class="bold"><strong>See Also:</strong></span></p>
<p>log_entry_start, log_entry_finish </p>
<p>
</p>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">os</code></span></p></td>
<td><p>output stream to write a messages into. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">value</code></span></p></td>
<td><p>log entry string value </p></td>
</tr>
</tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">virtual</span> <span class="keyword">void</span> <a name="idm47868-bb"></a><span class="identifier">log_entry_value</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&amp;</span> os<span class="special">,</span> <span class="identifier">lazy_ostream</span> <span class="keyword">const</span> <span class="special">&amp;</span> value<span class="special">)</span><span class="special">;</span></pre>Invoked by Unit Test Framework to report a log entry content. <p>This is one of two overloaded methods to report log entry content. This one is used to report some complicated expression passed as an expression template lazy_ostream. In most cases default implementation provided by the framework should work as is (it just converts the lazy expression into a string. 
</p>
<p><span class="bold"><strong>See Also:</strong></span></p>
<p>log_entry_start, log_entry_finish </p>
<p>
</p>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">os</code></span></p></td>
<td><p>output stream to write a messages into </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">value</code></span></p></td>
<td><p>log entry "lazy" value </p></td>
</tr>
</tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">virtual</span> <span class="keyword">void</span> <a name="idm47884-bb"></a><span class="identifier">log_entry_finish</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&amp;</span> os<span class="special">)</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span></pre>Invoked by Unit Test Framework to finish a log entry report. <p>
</p>
<p><span class="bold"><strong>See Also:</strong></span></p>
<p>log_entry_start, log_entry_start </p>
<p>
</p>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">os</code></span></p></td>
<td><p>output stream to write a messages into </p></td>
</tr></tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">virtual</span> <span class="keyword">void</span> <a name="idm47896-bb"></a><span class="identifier">entry_context_start</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&amp;</span> os<span class="special">,</span> <span class="identifier">log_level</span> l<span class="special">)</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span></pre>Invoked by Unit Test Framework to start log entry context report. <p>Unit Test Framework logs for failed assertions and uncaught exceptions context if one was defined by a test module. Context consists of multiple "scopes" identified by description messages assigned by the test module using BOOST_TEST_INFO/BOOST_TEST_CONTEXT statements. 
</p>
<p><span class="bold"><strong>See Also:</strong></span></p>
<p>log_entry_context, entry_context_finish </p>
<p>
</p>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">l</code></span></p></td>
<td><p>entry log_level, to be used to fine tune the message </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">os</code></span></p></td>
<td><p>output stream to write a messages into </p></td>
</tr>
</tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">virtual</span> <span class="keyword">void</span> 
<a name="idm47912-bb"></a><span class="identifier">log_entry_context</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&amp;</span> os<span class="special">,</span> <span class="identifier">log_level</span> l<span class="special">,</span> <span class="identifier">const_string</span> value<span class="special">)</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span></pre>Invoked by Unit Test Framework to report log entry context "scope" description. <p>Each "scope" description is reported by separate call to log_entry_context. 
</p>
<p><span class="bold"><strong>See Also:</strong></span></p>
<p>log_entry_start, entry_context_finish </p>
<p>
</p>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">l</code></span></p></td>
<td><p>entry log_level, to be used to fine tune the message </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">os</code></span></p></td>
<td><p>output stream to write a messages into </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">value</code></span></p></td>
<td><p>context "scope" description </p></td>
</tr>
</tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">virtual</span> <span class="keyword">void</span> <a name="idm47932-bb"></a><span class="identifier">entry_context_finish</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&amp;</span> os<span class="special">,</span> <span class="identifier">log_level</span> l<span class="special">)</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span></pre>Invoked by Unit Test Framework to finish log entry context report. <p>
</p>
<p><span class="bold"><strong>See Also:</strong></span></p>
<p>log_entry_start, entry_context_context </p>
<p>
</p>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">l</code></span></p></td>
<td><p>entry log_level, to be used to fine tune the message </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">os</code></span></p></td>
<td><p>output stream to write a messages into </p></td>
</tr>
</tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">virtual</span> <span class="keyword">void</span> <a name="idm47948-bb"></a><span class="identifier">set_log_level</span><span class="special">(</span><span class="identifier">log_level</span> new_log_level<span class="special">)</span><span class="special">;</span></pre>Sets the log level of the logger/formatter. <p>Some loggers need to manage the log level by their own. This member function let the implementation decide of that. </p>
<p><b>Since Boost 1.62 . </b></p>
<p>
</p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">virtual</span> <span class="identifier">log_level</span> <a name="idm47958-bb"></a><span class="identifier">get_log_level</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Returns the log level of the logger/formatter. <p><b>Since Boost 1.62 . </b></p>
<p>
</p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">virtual</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <a name="idm47966-bb"></a><span class="identifier">get_default_stream_description</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Returns a default stream for this logger. <p>The returned string describes the stream as if it was passed from the command line <code class="computeroutput">"--log_sink"</code> parameter. With that regards, <span class="bold"><strong>stdout</strong></span> and <span class="bold"><strong>stderr</strong></span> have special meaning indicating the standard output or error stream respectively.</p>
<p><b>Since Boost 1.62 . </b></p>
<p>
</p>
</li>
</ol></div>
</div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2001-2022 Boost.Test contributors<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
      </p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="log_entry_data.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../header/boost/test/unit_test_log_formatter_hpp.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../../header/boost/test/unit_test_parameters_hpp.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
